package cn.xinfei.xdecision.common.dao.component.dependency;

import cn.xinfei.xdecision.common.model.component.dependency.EngineNodeComponentRel;
import cn.xinfei.xdecision.common.model.component.dependency.resp.DecisionComponentDependencyResp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EngineNodeComponentRelMapper extends BaseMapper<EngineNodeComponentRel> {

    /**
     * 批量删除依赖关系
     */
    Integer batchUpdateDependency(@Param("list") List<EngineNodeComponentRel> list);

    /**
     * 通过引擎code查询全部子引擎
     */
    List<DecisionComponentDependencyResp> listByEngineNodeCodes(@Param("engineNodes") List<String> engineNodes,
                                                                @Param("componentType") Integer componentType,
                                                                @Param("status") Integer status);

    List<DecisionComponentDependencyResp> listByRuleCodes(List<String> ruleCodes);

}
